<?php

namespace app\admin\validate;

use app\common\lib\Captcha;
use think\db\exception\DataNotFoundException;
use think\db\exception\DbException;
use think\db\exception\ModelNotFoundException;
use think\Validate;

class Indicators extends Validate
{
    protected $rule = [
        'year' => 'require',
        'area' => 'require',
        'total' => 'require',
        'total_rate' => 'require',
        'talent_proportion' => 'require',
        'money' => 'require',
        'money_rate' => 'require',
        'city_money' => 'require',
        'city_money_rate' => 'require',
        'party' => 'require',
        'party_rate' => 'require',
        'enterprise' => 'require',
        'enterprise_rate' => 'require',
        'technology' => 'require',
        'technology_rate' => 'require',
        'high_skill' => 'require',
        'high_skill_rate' => 'require',
        'rural' => 'require',
        'rural_rate' => 'require',
        'social_work' => 'require',
        'social_work_rate' => 'require',
        'status' => 'require',
        'id' => 'require',
    ];

    protected $scene=[
        'create'=>['year','area','total','total_rate','talent_proportion','money','money_rate','city_money','city_money_rate','party','party_rate','enterprise','enterprise_rate','technology','technology_rate','high_skill','high_skill_rate','rural','rural_rate','social_work','social_work_rate','status'],
        'update'=>['year','area','total','total_rate','talent_proportion','money','money_rate','city_money','city_money_rate','party','party_rate','enterprise','enterprise_rate','technology','technology_rate','high_skill','high_skill_rate','rural','rural_rate','social_work','social_work_rate','status','id'],
    ];

    protected $message = [
        'year' => '年度不能为空',
        'area' => '地区不能为空',
        'total' => '人才总量不能为空',
        'total_rate' => '人才总量增长率不能为空',
        'talent_proportion' => '人才占比不能为空',
        'money' => '人才发展资金不能为空',
        'money_rate' => '人才发展资金增长率不能为空',
        'city_money' => '市本级发展资金不能为空',
        'city_money_rate' => '市本级发展资金增长率不能为空',
        'party' => '党政人才不能为空',
        'party_rate' => '党政人才增长率不能为空',
        'enterprise' => '企业人才不能为空',
        'enterprise_rate' => '企业人才增长率不能为空',
        'technology' => '专业技术人才不能为空',
        'technology_rate' => '专业技术人才增长率不能为空',
        'high_skill' => '高技能人才不能为空',
        'high_skill_rate' => '高技能人才增长率不能为空',
        'rural' => '农村实用人才不能为空',
        'rural_rate' => '农村实用人才增长率不能为空',
        'social_work' => '社会工作人才不能为空',
        'social_work_rate' => '社会工作人才增长率不能为空',
        'status' => '状态不能为空',
        'id' => 'ID不能为空',
    ];
}
